import http from './request.js'
  // getAddressList,
  // add,
  // del,
  // choose,
/**
 * 增加地址
 */
export function add({
  post_receiver,
  post_address,
  post_zip,
  post_phone,
  post_province,
  post_city,
  post_district
}) {

  return http.post('receiver/saveReceiver', {
    post_receiver,
    post_address,
    post_zip,
    post_phone,
    post_province,
    post_city,
    post_district
  });
}

/**
 * 
 * 编辑地址
 */
export function edit({
  receiver_id,
  post_receiver,
  post_address,
  post_zip,
  post_phone,
  post_province,
  post_city,
  // is_default,
  post_district
}) {

  return http.post('receiver/editReceiver', {
    receiver_id,
    post_receiver,
    post_address,
    post_zip,
    post_phone,
    post_province,
    post_city,
    // is_default,
    post_district
  });
}

/**
 * 
 * 设置默认地址
 */
export function choose({
  id,
  // is_default
}) {

  return http.post('receiver/editReceiver', {
    receiver_id: String(id),
    is_default: '1' //1 默认地址  0 不是默认地址
  });
}
/**
 * 
 * 删除地址
 */
export function del({
  id,
  // is_default
}) {

  return http.post('receiver/deleteReceiver', {
    receiver_id: String(id),

  });
}
/**
 * 
 * 获取地址列表
 */
export function getAddressList({
  // receiver_id,
  // is_default
}) {

  return http.post('receiver/getReceiverList', {
    // receiver_id,

  });
}

/**
 * 
 * 获取地址详情
 */
export function getDetailReceiver({
  receiver_id,
  // is_default
}) {

  return http.post('receiver/getReceiver', {
    receiver_id,

  });
}